
<h2>Nhập kết quả lô đề</h2>
<script>
    function layKetQuaXoSoHomNay()
    {
        $('#preview').html('').hide();
        $.ajax({
            url: 'LayKetQuaXoSo',
            type: 'POST',
            data: {date: $('#date').val()},
            beforeSend: function()
            {
                $('#ketquaXoSo').html('<img src="../../../images/ajax-loader.gif"/>');
            },
            success: function(data)
            {
                $('#ketquaXoSo').html(data).hide().show(500);
                var dacbiet = $('#Giai_DacBiet').text();
                $('#x80').val(dacbiet.toString().substr(dacbiet.toString().length-2, 2));
                $('#x8').val(dacbiet.toString().substr(dacbiet.toString().length-2, 2).toString().split('').join('-'));
                
                arrLo = Array();
                $('.tinh_lo').each(function (index, obj){
                    arrTemp = $(this).text().split('-');
                    for(item in arrTemp)
                    {
                        arrLo.push(arrTemp[item].toString().substr(arrTemp[item].toString().length-2, 2));
                    }
                });
                $('#x3dot5').val(arrLo.join('-'));
            }
        }
    );
    }
 
    
</script>

<div id="ketquaXoSo">

</div>
<div id="ketquaLoDe">
    <form action="NhapKetQuaLoDe" method="post">
        Ngày: <input type="text" id="date" name="date" value="<?php echo date('Y-m-d'); ?>"/>
        <br/>
        <table width="100%" border="1">
            <tbody><tr>
                    <td width="11%" style="color:red; text-align:center"><h3><strong>X80</strong></h3></td>
                    <td width="24%" style="color:red; text-align:center"><h3><strong>X8</strong></h3></td>
                    <td width="65%" style="color:red; text-align:center"><h3><strong>X3.5</strong></h3></td>
                </tr>
                <tr>
                    <td style="color: green; text-align:center"><input name="x80" id="x80" type="text"/></td>
                    <td style="color:green; text-align:center"><input name="x8" id="x8" type="text"/></td>
                    <td align="center" style="color:green; text-align:left"><textarea name="x3dot5" id="x3dot5" rows="10" cols="50"></textarea></td>
                </tr>
            </tbody>
        </table>
        <input type="button" class="button active" value="Lấy kết quả tự động" onclick="layKetQuaXoSoHomNay();" />
        <br/><br/>
        <input type="submit" class="button active" value="Nhập kết quả"/>
        <input type="reset" class="button active" value="Reset"/>
        </form>
</div>
<hr/>
<div id="preview">
</div>